<template>
  <div v-if="!showMobilePage" class="data-info-item">
    <img v-if="iconImg" :src="iconImg? iconImg : ''" class="icon-img" alt="">
    <i :class="elIconName? elIconName : ''" class="info-icon" />
    <div v-if="isDot" class="dot" />
    <div :style="{ 'font-weight': isFontWeight? 'bold' : 'normal', 'color': labelColor }" class="lable">{{ label }}</div>
    <div class="content">
      <slot name="content" />
    </div>
  </div>
  <div v-else class="data-info-mobile">
    <div class="dot" />
    <div class="data-info-item-mobile">
      <div class="info-item-row">
        <div :style="{ 'font-weight': isFontWeight? 'bold' : 'normal', 'color': labelColor }" class="lable">{{ label }}</div>
      </div>
      <div class="content">
        <slot name="content" />
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'DataInfoItem',
  props: {
    label: {
      type: String,
      default: ''
    },
    elIconName: {
      type: String,
      default: ''
    },
    iconImg: {
      type: String,
      default: ''
    },
    isFontWeight: {
      type: Boolean,
      default: false
    },
    labelColor: {
      type: String,
      default: '#666'
    },
    showMobilePage: {
      type: Boolean,
      default: false
    },
    isDot: {
      type: Boolean,
      default: false
    }
  }
};
</script>
<style lang="scss" scoped>
.data-info-item {
  display: flex;
  align-items: center;
  margin-right: 16px;
  .icon-img {
    height: 16px;
    width: 16px;
  }
  .info-icon {
    margin-right: 4px;
    font-size: 16px;
    color: #999;
  }
  .lable {
    color: #666;
    margin-right: 10px;
    font-size: 14px;
  }
  .content {
    color: #333;
    font-size: 14px;
  }
}
.dot {
  background-color: #DDDDDD;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
}
.data-info-mobile {
  display: flex;
  .dot {
    margin: 5px 5px 0;
  }
  .data-info-item-mobile {
    flex: 1;
    .info-item-row {
      white-space: nowrap;
    }
  }
}
</style>
